package cn.bossfriday.im.user;

import cn.bossfriday.common.plugin.PluginApplication;
import cn.bossfriday.common.plugin.PluginSpringContext;
import cn.bossfriday.im.common.PluginBootstrap;
import cn.bossfriday.im.common.conf.ConfigurationAllLoader;
import lombok.extern.slf4j.Slf4j;

import static cn.bossfriday.im.common.constant.ImConstant.BASE_PACKAGE_NAME;
import static cn.bossfriday.im.common.constant.ImConstant.SERVICE_NAME_USER;

/**
 * UserBootstrap
 * <p>
 * 用户服务
 *
 * @author chenx
 */
@Slf4j
@PluginApplication(name = SERVICE_NAME_USER)
public class UserBootstrap extends PluginBootstrap {

    @Override
    protected void start() {
        try {
            // ...
        } catch (Exception ex) {
            log.error("Bootstrap.start() error!", ex);
        }
    }

    @Override
    protected void stop() {
        try {
            // ...
        } catch (Exception ex) {
            log.error("Bootstrap.stop() error!", ex);
        }
    }

    /**
     * 本地测试启动入口
     */
    public static void main(String[] args) {
        PluginSpringContext.initialize(BASE_PACKAGE_NAME);
        PluginBootstrap plugin = new UserBootstrap();
        plugin.startup(ConfigurationAllLoader.getInstance().getSystemConfig());
    }
}
